package com.wl.service;

import com.wl.pojo.Articles;
import com.wl.pojo.model.ArticleModel;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @program: treeHole
 * @author: 吴磊
 * @create: 2021-07-06 18:15
 */
public interface ArticlesService {

    /**
     * 获取用户的可以喜欢
     *
     * @param request
     * @return
     */
    Map<String, Object> getUserMayBeLike(HttpServletRequest request);


    /**
     * 用户浏览文章操作
     *
     * @param request
     */
    void browseArticleRecord(HttpServletRequest request);


    /**
     * 通过类型获取全部文章（分页）
     *
     * @param userId
     * @param type
     * @param curPage
     * @return
     */
    Map<String, Object> getOwnerArticleByType(String userId, String type, String curPage);


    /**
     * 获取所有文章
     *
     * @param request
     * @return
     */

    Map<String, Object> getAllArticle(HttpServletRequest request);

    /**
     * 根据标签找到相同标签的文章
     *
     * @param request
     */
    Map<String, Object> getArticleByLabel(HttpServletRequest request);

    /**
     * 通过或者拒绝文章
     *
     * @param request
     */
    void passAndRefusedArticle(HttpServletRequest request);

    /**
     * 审核文章
     *
     * @return
     */
    Articles auditArticle(HttpServletRequest request);


    /**
     * 插入文章
     *
     * @param request
     * @param articles
     * @return
     */
    boolean insertArticle(HttpServletRequest request, Articles articles);

    /**
     * 根据文章Id删除文章
     *
     * @param articles
     * @return
     */
    boolean deleteArticleById(Articles articles);

    /**
     * 通过文章Id获取单篇文章
     *
     * @param request
     * @param articleId
     * @return
     */
    ArticleModel getOneArticleById(HttpServletRequest request, String articleId);

    /**
     * 给文章点赞或者取消点赞
     *
     * @param request
     * @param articleId
     * @return
     */
    Long articleUp(HttpServletRequest request, String articleId);

    /**
     * 给文章踩赞或者取消踩赞
     *
     * @param request
     * @param articleId
     * @return
     */
    Long articleDown(HttpServletRequest request, String articleId);

    /**
     * 获取不同类型的文章
     *
     * @param request
     * @return
     */
    Map<String, Object> getArticleBySome(HttpServletRequest request);

    /**
     * 按关键词搜索文章
     *
     * @param request
     * @return
     */
    Map<String, Object> searchArticles(HttpServletRequest request);

}
